﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;

namespace EasyBuildingCMS.Base
{
    public class BasePage : Page
    {
        public bool IsAdmin
        {
            get
            {
                return (User.Identity.IsAuthenticated & User.IsInRole("Administrator"));
            }
        }

        public bool IsEditor
        {
            get
            {
                return (User.Identity.IsAuthenticated & User.IsInRole("Editor"));
            }
        }

        public bool IsMember
        {
            get
            {
                return (User.Identity.IsAuthenticated & User.IsInRole("Member"));
            }
        }

        public bool HasEditRight
        {
            get
            {
                if (IsAdmin | IsEditor) return true;
                else return false;
            
            }
        }
    }
}